package com.hongning.railway.entity.resbean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

public class ResCadreBean implements Parcelable {
    /**
     * id : 1007
     * cadretestname : 可能还需要测试
     * cadreteststoptime : 1567267703000
     * cadretesttype : 1
     * createTime : null
     * htmlstate : 2(0未开始，1进行中，2已截止，3已提交，99已撤销)
     * ext1 : null
     * ext2 : null
     * tcCdCadresTestscores : []
     */

    private String id;
    private String cadretestname;
    private long cadreteststoptime;
    private String cadretesttype;
    private long createTime;
    private String htmlstate;
    private String ext1;
    private String ext2;
//    private List<String> tcCdCadresTestscores;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCadretestname() {
        return cadretestname;
    }

    public void setCadretestname(String cadretestname) {
        this.cadretestname = cadretestname;
    }

    public long getCadreteststoptime() {
        return cadreteststoptime;
    }

    public void setCadreteststoptime(long cadreteststoptime) {
        this.cadreteststoptime = cadreteststoptime;
    }

    public String getCadretesttype() {
        return cadretesttype;
    }

    public void setCadretesttype(String cadretesttype) {
        this.cadretesttype = cadretesttype;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public String getHtmlstate() {
        return htmlstate;
    }

    public void setHtmlstate(String htmlstate) {
        this.htmlstate = htmlstate;
    }

    public String getExt1() {
        return ext1;
    }

    public void setExt1(String ext1) {
        this.ext1 = ext1;
    }

    public String getExt2() {
        return ext2;
    }

    public void setExt2(String ext2) {
        this.ext2 = ext2;
    }

//    public List<String> getTcCdCadresTestscores() {
//        return tcCdCadresTestscores;
//    }
//
//    public void setTcCdCadresTestscores(List<String> tcCdCadresTestscores) {
//        this.tcCdCadresTestscores = tcCdCadresTestscores;
//    }

    public String getStatuString(){
//        (0未开始，1进行中，2已截止，3已提交，99已撤销)
        switch (htmlstate){
            case "0":
                return "未开始";
            case "1":
                return "进行中";
            case "2":
                return "已截止";
            case "3":
                return "已提交";
            case "99":
                return "已撤销";
            default:
                return "";
        }
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.cadretestname);
        dest.writeLong(this.cadreteststoptime);
        dest.writeString(this.cadretesttype);
        dest.writeLong(this.createTime);
        dest.writeString(this.htmlstate);
        dest.writeString(this.ext1);
        dest.writeString(this.ext2);
//        dest.writeStringList(this.tcCdCadresTestscores);
    }

    public ResCadreBean() {
    }

    protected ResCadreBean(Parcel in) {
        this.id = in.readString();
        this.cadretestname = in.readString();
        this.cadreteststoptime = in.readLong();
        this.cadretesttype = in.readString();
        this.createTime = in.readLong();
        this.htmlstate = in.readString();
        this.ext1 = in.readString();
        this.ext2 = in.readString();
//        this.tcCdCadresTestscores = in.createStringArrayList();
    }

    public static final Parcelable.Creator<ResCadreBean> CREATOR = new Parcelable.Creator<ResCadreBean>() {
        @Override
        public ResCadreBean createFromParcel(Parcel source) {
            return new ResCadreBean(source);
        }

        @Override
        public ResCadreBean[] newArray(int size) {
            return new ResCadreBean[size];
        }
    };
}